package com.css.JUC01;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

public class MapTest {
    public static void main(String[] args) {
//        Map objectMap= Collections.synchronizedMap(new HashMap<>());
        Map objectMap=new ConcurrentHashMap();
        for (int i = 1; i <=30 ; i++) {
            new Thread(()->{
                objectMap.put(Thread.currentThread().getName(), UUID.randomUUID().toString().substring(0,3));
                System.out.println(objectMap);
            },String.valueOf(i)).start();
        }

    }
}
